package com.ewanghuiju.app.ui.main.adapter;

import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ewanghuiju.app.R;
import com.ewanghuiju.app.component.ImageLoader;
import com.ewanghuiju.app.model.bean.response.RedEnvelopesDetailsResponBean;
import com.makeramen.roundedimageview.RoundedImageView;

/**
 * @author sj  qq:751943509
 * @class 红包开奖列表
 * @time 2020/2/20
 */
public class RedEnvelopesAdapter extends BaseQuickAdapter<RedEnvelopesDetailsResponBean, BaseViewHolder> {
    public RedEnvelopesAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, RedEnvelopesDetailsResponBean item) {
        helper.setText(R.id.tv_nickname, TextUtils.isEmpty(item.getNickname()) ? "" : item.getNickname());
        helper.setText(R.id.tv_amount, TextUtils.isEmpty(item.getPrice()) ? "" : item.getPrice());
        helper.setText(R.id.tv_time, TextUtils.isEmpty(item.getCreate_time()) ? "" : item.getCreate_time());

        RoundedImageView rivHead = helper.getView(R.id.riv_head);
        ImageLoader.load(mContext, item.getUser_image(), rivHead);
    }
}
